UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QxXaruPHO/V0O0HU6PpXCmjdW1EgfkY4wvVy0DccTJk='
WHERE
key_id = 'd61af28231f87f23edd354b8788d812ba737152055715ef52b20b2f548d8c823'
AND (
token = 'QxXaruPHO/V0O0HU6PpXCmjdW1EgfkY4wvVy0DccTJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)