UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5DZ1DK0wXFz3Psiglp/mLfJQiyI5NHOEqXLsRq6xUjk='
WHERE
key_id = '8b5050224df82b19a9d930e4f9197e175bbb5f1cee9927f3cf289d9d79a59f4c'
AND (
token = '5DZ1DK0wXFz3Psiglp/mLfJQiyI5NHOEqXLsRq6xUjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)