UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2eJkEiay0C4UQ1xDNCMpGd09QO6snDUhAYfaYJjJYJQ=' 
WHERE 
  key_id = '563b1b31c034af60c57a6425050cc86faae38dd0228164b4dca70e1086e66b77' 
  AND (
    token = '2eJkEiay0C4UQ1xDNCMpGd09QO6snDUhAYfaYJjJYJQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029