UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UA0XbHiLuxA2WF59e9YJD4AerKdYtvLBEdZBAOrhgAE=' 
WHERE 
  key_id = '53c7c595e7f91e78fe2ce401c1c58c77e962fa807ceb1950ca705576aee4c126' 
  AND (
    token = 'UA0XbHiLuxA2WF59e9YJD4AerKdYtvLBEdZBAOrhgAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030