UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FTpjDp0eUfZAd6K4OkwUF0wm7sw+zJFmu5cPXUU+g44=' 
WHERE 
  key_id = '28bc6f4fd3d105754f32b7ef009fb850edd94ed56b882a6ccb5d51e69023359c' 
  AND (
    token = 'FTpjDp0eUfZAd6K4OkwUF0wm7sw+zJFmu5cPXUU+g44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028