UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CGpvLzDTBUiUGqkzjUGJehlNep8l1F+z1EPa6sZbeeg='
WHERE
key_id = '99083973f3b4d61d39401e4da1d948fdf6bb8288385322ed21fe14e62ea396c8'
AND (
token = 'CGpvLzDTBUiUGqkzjUGJehlNep8l1F+z1EPa6sZbeeg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)