UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5IGzeFltte2Wl7+fht+ihX3sev0jccpxzzSgPpxaNrk=' 
WHERE 
  key_id = 'e08dd9459620228f4af3ed8abfbf569aa3708af24e4adabbe4714c412c91727b' 
  AND (
    token = '5IGzeFltte2Wl7+fht+ihX3sev0jccpxzzSgPpxaNrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050