UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LGYTZTdA8xrXsUMCyhFfSMDxE2mUknGdTVxoGWf24ds=' 
WHERE 
  key_id = 'a280ee9f76557c2855373517ed525b8c6681b9d7aa36e20f89341885251b2d70' 
  AND (
    token = 'LGYTZTdA8xrXsUMCyhFfSMDxE2mUknGdTVxoGWf24ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036