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

Query time 0.00072