UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CgdexKVnYSnd8jqXDfowoBKMo0nVpAgVQWo8LD8GWUw='
WHERE
key_id = '9d44847c01abd89d11b2483d844628c36c10bcba4368c55aeefe9767c57e250e'
AND (
token = 'CgdexKVnYSnd8jqXDfowoBKMo0nVpAgVQWo8LD8GWUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)