UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's1yywAeEac6D8QiNzsa9agf3hPIAICUpZ0wC1vPEvYc=' 
WHERE 
  key_id = '1ad5dd199d34466d9aa863094a2f5f0309eb7e33ae9b642317c1da5483a0cfd7' 
  AND (
    token = 's1yywAeEac6D8QiNzsa9agf3hPIAICUpZ0wC1vPEvYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031