UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AFTTfR7dzgpBxuv+fqwlAOYrSKpyot6bIBpzO8nwFAE='
WHERE
key_id = '5ff45eb460b86a13d34d2f9136660d77ccd6de7b075b29c4edc8b4f08ad9a34f'
AND (
token = 'AFTTfR7dzgpBxuv+fqwlAOYrSKpyot6bIBpzO8nwFAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)