UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'chwZ0UjX/rtqiOkR753I7f0neMWxuq/BFJcMoux1MbQ='
WHERE
key_id = '9109e583ee95d3ae089f35cb75970589d114196353dfbf4faacb1edceacdf54f'
AND (
token = 'chwZ0UjX/rtqiOkR753I7f0neMWxuq/BFJcMoux1MbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)