UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bQF41jGPIGBf9HHsZqYQ16reVRc2yUI1qz9ABicNxuc=' 
WHERE 
  key_id = 'cca0c82a7c2999112d2401b29b64ffcd55b51847fcbffbf5a58f15cc5eb50d69' 
  AND (
    token = 'bQF41jGPIGBf9HHsZqYQ16reVRc2yUI1qz9ABicNxuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041