UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3HQxIoKeZ/UbJLuM17E1bQkVkdY3jGOgMLv7W7mhKXE='
WHERE
key_id = '9ddd65bbdc70e3aa08b098b538c61c8fb4741bbbb1ff891b5271127ae6e8da8c'
AND (
token = '3HQxIoKeZ/UbJLuM17E1bQkVkdY3jGOgMLv7W7mhKXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)