UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VAbOgJrpd6nLKxzSToi0PW39LreOuVpJ8JePkY2ys3A='
WHERE
key_id = 'de981545046b7ae55fbdb3df3c3033507351f300fc6768f1aabcce8b88464e25'
AND (
token = 'VAbOgJrpd6nLKxzSToi0PW39LreOuVpJ8JePkY2ys3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)