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

Query time 0.00036