UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y5qaXcc8gyInLgBoixWx9+n7b0dK9+ZCfRCApAKl9/I='
WHERE
key_id = '171cda606e86c8b1afe33ede11f9366c9fad875c321a77b7e045f42f6f4768c8'
AND (
token = 'Y5qaXcc8gyInLgBoixWx9+n7b0dK9+ZCfRCApAKl9/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)