UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZwodkNvMIubxQWiFZtpnn3TbjMCj1QA7N7ux9VEhUAE=' 
WHERE 
  key_id = '381cb9e36e64070bbb7aae5baf3cc2cc0ce0c841f6257b400355e78044b452c0' 
  AND (
    token = 'ZwodkNvMIubxQWiFZtpnn3TbjMCj1QA7N7ux9VEhUAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045