UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TB5SuRHUqoprTrMfzUXy5OcUhNtpxLEx7G6eSygQKos=' 
WHERE 
  key_id = '262c22286c271d435ff49dfb01e0502264e4748fb9d35b04daccc4f0eb6d8ff6' 
  AND (
    token = 'TB5SuRHUqoprTrMfzUXy5OcUhNtpxLEx7G6eSygQKos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031