UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98Iy+1EgBlA25Nm6FYcWm0rymbK2RBdqfo8VpbZ7G0w='
WHERE
key_id = '439b282afa0e0be7a2bee0703eca35f1c7317e1f97f905f728c9050afe91f72f'
AND (
token = '98Iy+1EgBlA25Nm6FYcWm0rymbK2RBdqfo8VpbZ7G0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)