UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6VYROAZbDuadER7kTFSVygKX4hwnQVe2Ue2c7Ftiboc='
WHERE
key_id = 'e92966380ebb19879d4304ecae31beadca9f7e17078c906b79b03b703c2d01e8'
AND (
token = '6VYROAZbDuadER7kTFSVygKX4hwnQVe2Ue2c7Ftiboc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)