UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vns9zxKcNc7jy/W7lNak/Ao+E7+XQTUjYWnOascBMt4='
WHERE
key_id = '99b8c233d6b888c908f66e18fee0a557b17e21c6c30ac9d60879d1bc23acbd8f'
AND (
token = 'Vns9zxKcNc7jy/W7lNak/Ao+E7+XQTUjYWnOascBMt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)