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

Query time 0.00028