UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHkb/6CzpJeA8vKDZiRlmMpLFDL1s+WR5kmesHlzlZ8='
WHERE
key_id = '11d155d84b6b7e1c37e307716ef83f1b174e3d493e025986d4daeb2bfe987c10'
AND (
token = 'lHkb/6CzpJeA8vKDZiRlmMpLFDL1s+WR5kmesHlzlZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)