UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qTEiD7Dt8/mx0cvEEiDCClqoNPU4blCSeLbiupVUoEE='
WHERE
key_id = 'f32c330b2c77e2940389e9a7d696a612d88aeeed7dc2fc14a741add673045c08'
AND (
token = 'qTEiD7Dt8/mx0cvEEiDCClqoNPU4blCSeLbiupVUoEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)