UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10npiqLuUj8PfIXVdq7nw2nN1iQOjD0LwCuwOeMXWqM='
WHERE
key_id = 'e89ca897cdd9033ef64e512846313dc43c4378797ccbcbc30b78f1fa248675ab'
AND (
token = '10npiqLuUj8PfIXVdq7nw2nN1iQOjD0LwCuwOeMXWqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)