UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8nWer1D/PFq5isIMi3LH/kUf5ZjTnk3dVwmM0LLIz9Q='
WHERE
key_id = '69ec1ad3f9d6ee2138209537137ae12d835712bfbb590999b70f6e45c8d43364'
AND (
token = '8nWer1D/PFq5isIMi3LH/kUf5ZjTnk3dVwmM0LLIz9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)