UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gszFAiYJeDVDrsgG3j56cS1s8jz+JOQ/xTQdQaUuGb0=' 
WHERE 
  key_id = '7cde36122b948bef03a9eb47d21cf2222f9756eb1bf916c7be5199192e74e2e6' 
  AND (
    token = 'gszFAiYJeDVDrsgG3j56cS1s8jz+JOQ/xTQdQaUuGb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048