UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+vId8hLzVHkpUBOM0ZoU6nIIUNXq1zNdI4GOUALxPTA='
WHERE
key_id = '5286c9ed360883289adb2132e90837476166b494c321d3476742287a5e32ad10'
AND (
token = '+vId8hLzVHkpUBOM0ZoU6nIIUNXq1zNdI4GOUALxPTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)