UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CZ64yfeHuaNLj1j9eXxA6E27yOV+BY7MyOpL6xQkTck='
WHERE
key_id = '7647dc9946aeffcf167bb3cfc86e38967cf57851632ee41078945908245b4222'
AND (
token = 'CZ64yfeHuaNLj1j9eXxA6E27yOV+BY7MyOpL6xQkTck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)