UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pnHT6XdBDWhT0Cf8Y/qxXhf8v1V61zH5Vtgpc5zTJVo='
WHERE
key_id = '037b4861c708e6f788e019dbc939bd47221a48a4a7fe591851ee2d8fb73f38e9'
AND (
token = 'pnHT6XdBDWhT0Cf8Y/qxXhf8v1V61zH5Vtgpc5zTJVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)