UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91mn1XH5y427V8UuayvGKnV3kihbfRlgkwmm+CT390Y='
WHERE
key_id = 'ddb04ba88941a0ed9dd3ef6f1263e9dd827ff764050d6ebf00790223b0de1b4f'
AND (
token = '91mn1XH5y427V8UuayvGKnV3kihbfRlgkwmm+CT390Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)