UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bEjDJtRPlI+poVXotpb+5O/qur2dJc6uN4xCwpW7VKA=' 
WHERE 
  key_id = '001c81570b67d5805adb697829378db676a15aaeb18e8d71da8f1eceb149eaba' 
  AND (
    token = 'bEjDJtRPlI+poVXotpb+5O/qur2dJc6uN4xCwpW7VKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028