UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RbGFnFCsLIgXWTZCgvTI3lOw6vylYAnaOzcOSflPMeg='
WHERE
key_id = '35335eed62ea6819467544226619fc2a471e48c8c24064e7e7e43f95f23fe733'
AND (
token = 'RbGFnFCsLIgXWTZCgvTI3lOw6vylYAnaOzcOSflPMeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)