UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Oqr126OaP9MU+ed0MbpG9jRTk1zyKjwpW9B9C9M1z0=' 
WHERE 
  key_id = '8247570f9e3c93dc2dbacedf8f199deb365cd0d4591ed67b32c40bddf5a40036' 
  AND (
    token = '3Oqr126OaP9MU+ed0MbpG9jRTk1zyKjwpW9B9C9M1z0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031