UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UCUxuzOJpIUAszIlIA8EMtAehmaVX8XjjovYbKaCRgs=' 
WHERE 
  key_id = 'eb5b8020307204921f8f59c125d72abc4dc00485488ef410e22fcfdb0407b6d6' 
  AND (
    token = 'UCUxuzOJpIUAszIlIA8EMtAehmaVX8XjjovYbKaCRgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019