UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6rwMyVf0kd/XTpvlmueAXt3t0R2f4scmmxOu5NsDBs=' 
WHERE 
  key_id = '2963c697c05729e6b26a9a18ca6a0bd63c6c8229b5832695aca5eaac14092dee' 
  AND (
    token = 'F6rwMyVf0kd/XTpvlmueAXt3t0R2f4scmmxOu5NsDBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015