UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'srg0QhZ03VLwQOi4356nk2rbEWLhusGOUviHKX/iTps=' 
WHERE 
  key_id = 'b26e29c0846482321bf59e53943ccca24ad311c35d5cbaae3ede046b8cc915ac' 
  AND (
    token = 'srg0QhZ03VLwQOi4356nk2rbEWLhusGOUviHKX/iTps=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025