UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3tXrDKtHzModvzHVv1lzpIS+sM9CcXs9J+x+6n3/4ow=' 
WHERE 
  key_id = 'cf41f2309d678e03d69a0efe0bacb189c4243e726bf3c0b1b744d9f58843c2e9' 
  AND (
    token = '3tXrDKtHzModvzHVv1lzpIS+sM9CcXs9J+x+6n3/4ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036