UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KQ/eRujSZ3EJM5fee5VDooKcA4WL/OBpJXyoqf0jIf8='
WHERE
key_id = '88bb3a29344d614c372f5708c211ee1efb2451f661f29609680732cfb91af31d'
AND (
token = 'KQ/eRujSZ3EJM5fee5VDooKcA4WL/OBpJXyoqf0jIf8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)