UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EwY4gm64VGrpFN+uOhNKQynd/Qzw1vhl88K1JfwZSlo='
WHERE
key_id = '65c2aa9781099b9eb3de7f43d99314792223b1828aec28bd812949d45e48514a'
AND (
token = 'EwY4gm64VGrpFN+uOhNKQynd/Qzw1vhl88K1JfwZSlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)