UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qVSVHOF3q4Gjipd7Ww6YRAsSHOo1BYUxKy0A1h7bjPk=' 
WHERE 
  key_id = '95a04d1bb9a658b6a8e89ca594fda23ccfa0a10510c4aba218fce1a4293fe7ea' 
  AND (
    token = 'qVSVHOF3q4Gjipd7Ww6YRAsSHOo1BYUxKy0A1h7bjPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020